package com.gxa.xly2024.controller;

import com.gxa.xly2024.pojo.Admin;
import com.gxa.xly2024.service.impl.AdminServiceImpl;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/login")
public class AdminController {

    @Resource
    private AdminServiceImpl adminService;

    @PostMapping("/selectLogin")
    public Map<String, Object> selectLogin(@RequestBody Admin admin) {
        return this.adminService.selectLogin(admin.getUser_name(), admin.getUser_pwd());
    }
    @PostMapping("/selectId")
    public Map<String, Object> selectId(@RequestBody Integer id) {
        return this.adminService.selectId(id);
    }
    @PostMapping("/insertsign")
    public Map<String, Object> insertsign(@RequestBody Admin admin) {
        return this.adminService.insertsign(admin.getUser_name(), admin.getUser_pwd());
    }
}